#include<iostream>
#include<map>
#include<ctime>
#include<vector>
using namespace std;

#include "AVL.hpp"

int main()
{
//    int a[]={16, 3, 7, 11, 9, 26, 18, 14, 15};
//    AVLTree<int, int> t;
//    for(auto e: a)
//    {
//        t.Insert(make_pair(e, e));
//    }
//
//    t.InOrder();
    
    vector<int> v;
    
    int N=1000000;
    srand((unsigned int)time(nullptr));
    
    for(int i=0;i<N;i++)
    {
        v.push_back(rand()+i);
    }
    
    AVLTree<int, int> t;
    for(auto& ch:v)
    {
        t.Insert(make_pair(ch,ch));
    }
    
    size_t begin1=clock();
    cout<<t.Size()<<endl;
    size_t end1=clock();
    cout<<end1-begin1<<endl;
    
    
    size_t begin2=clock();
    cout<<t.Find(rand()-10000)<<endl;
    size_t end2=clock();
    cout<<end2-begin2<<endl;
    return 0;
}
